package com.jwater.console.model;
/**
 * @description:
 * @author: jnner
 * @createDate: 2021/2/5
 * @version: 1.0
 */
public class Result {
	private boolean success;
	private boolean login;
	private String msg;
	private Object data;
	private String token;

	public static Result success() {
		Result result = new Result();
		result.setSuccess(true);
		result.setLogin(true);
		return result;
	}

	public static Result success(Object data) {
		Result result = new Result();
		result.setSuccess(true);
		result.setLogin(true);
		result.setData(data);
		return result;
	}

	public static Result error(String msg) {
		Result result = new Result();
		result.setSuccess(false);
		result.setLogin(true);
		result.setMsg(msg);
		return result;
	}

	public static Result notLogin(String msg) {
		Result result = new Result();
		result.setSuccess(false);
		result.setLogin(false);
		result.setMsg(msg);
		return result;
	}

	public boolean getSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public boolean getLogin() {
		return login;
	}

	public void setLogin(boolean login) {
		this.login = login;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}
}
